//
//  ShopModel.swift
//  myMoya
//
//  Created by xiaoyi on 2020/4/26.
//  Copyright © 2020 lete. All rights reserved.
//

import UIKit

import ObjectMapper

class ShopModel: Mappable {
    
    var shop_config: ShopConfigModel?
    var banner: [ShopBannerModel] = [ShopBannerModel]()
    var sidebar: [ShopSidebarModel] = [ShopSidebarModel]()
    var recommend: [ShopRecommendModel]!
    var other: [Any]?
    var special: [Any]?
    var promoteEndTime: TimeInterval = 0
    var serverTime: TimeInterval = 0
    var disable_show: Bool = false
    
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        shop_config    <- map["shop_config"]
        banner         <- map["banner"]
        sidebar      <- map["sidebar"]
        recommend  <- map["recommend"]
        other  <- map["other"]
        special         <- map["special"]
        promoteEndTime      <- map["promoteEndTime"]
        serverTime  <- map["serverTime"]
        disable_show  <- map["disable_show"]
    }
    
}

class ShopConfigModel: Mappable {
    
    var keywords: String = ""
    var description: String = ""
    
    required init?(map: Map) {
    }
    
    func mapping(map: Map) {
        keywords    <- map["keywords"]
        description         <- map["description"]
        
    }
    
}


class ShopBannerModel: Mappable {
    
    var name: String?
    var type: String = ""
    var image: String = ""
    var link: String = ""
    
    required init?(map: Map) {
    }
    func mapping(map: Map) {
        name    <- map["name"]
        type         <- map["type"]
        image    <- map["image"]
        link         <- map["link"]
    }
}

class ShopSidebarModel: Mappable {
    
    var name: String = ""
    var type: String = ""
    var cat_id: String = ""
    var flag: Int?
    var banner_list: [ShopBannerModel]?
    var is_list: Int?
    
    
    required init?(map: Map) {
    }
    func mapping(map: Map) {
        name    <- map["name"]
        type         <- map["type"]
        cat_id    <- map["cat_id"]
        flag         <- map["flag"]
        banner_list    <- map["banner_list"]
        is_list         <- map["is_list"]
    }
}

class ShopRecommendModel: Mappable {
    
    var goods_name: String = ""
    var short_name: String = ""
    var goods_thumb: String = ""
    var goods_img: String = ""
    var short_desc: String = ""
    var goods_id: Int?
    var price: Double?
    
    
    required init?(map: Map) {
    }
    func mapping(map: Map) {
        goods_name    <- map["goods_name"]
        short_name         <- map["short_name"]
        goods_thumb    <- map["goods_thumb"]
        goods_img         <- map["goods_img"]
        short_desc    <- map["short_desc"]
        goods_id         <- map["goods_id"]
        price    <- map["price"]
    }
}
